package com.example.mymvvmdemo.models.main;

import android.app.Activity;

import androidx.fragment.app.FragmentActivity;

import com.example.mymvvmdemo.R;
import com.example.mymvvmdemo.base.BaseViewModel;
import com.example.mymvvmdemo.entity.CommonEntity;
import com.example.mymvvmdemo.models.about.AboutActivity;
import com.example.mymvvmdemo.models.add_device.AddDeviceActivity;
import com.example.mymvvmdemo.models.add_device.entity.DeviceTypeListEntity;
import com.example.mymvvmdemo.models.article_detail.ArticleDetailActivity;
import com.example.mymvvmdemo.models.device_detail.DeviceDetailActivity;
import com.example.mymvvmdemo.models.main.fragment.device.DeviceFragment;
import com.example.mymvvmdemo.models.main.fragment.device.entity.DeviceListEntity;
import com.example.mymvvmdemo.models.main.fragment.home.entity.BlogArticlesEntity;
import com.example.mymvvmdemo.models.main.fragment.notification.entity.MessageMessagesEntity;
import com.example.mymvvmdemo.models.message_detail.MessageDetailActivity;
import com.example.mymvvmdemo.models.my_article.MyArticleActivity;
import com.example.mymvvmdemo.models.user_info.UserInfoActivity;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MainViewModel extends BaseViewModel {


    //用来记录用户是否处于设备轮询状态
    public long lastCurrent = 0L; //触摸开始时间
    public int num = 1; //记录次数
    public boolean isRefresh = true;//是否刷新


    /***********************************首页***********************************/
    public final long BANNER_DELAY = 3000; // 3秒切换一次
    public boolean isUserTouching = false;

    public List<Integer> bannerImages = Arrays.asList(R.mipmap.ic_banner1, R.mipmap.ic_banner2, R.mipmap.ic_banner3, R.mipmap.ic_banner4, R.mipmap.ic_banner5);
    public ArrayList<BlogArticlesEntity.DataDTO> homeList = new ArrayList<>();
    public ArrayList<BlogArticlesEntity.DataDTO> searchList = new ArrayList<>();

    /***********************************设备***********************************/
    public ArrayList<DeviceListEntity.DataDTO.DevicesDTO> deviceList = new ArrayList<>();

    /***********************************消息***********************************/
    public ArrayList<MessageMessagesEntity.DataDTO.ResultsDTO> notificationList = new ArrayList<>();

    /***********************************我的***********************************/
    public ArrayList<CommonEntity> mineList = new ArrayList<>();
    public int TYPE_SET = 1;
    public int TYPE_NOTIFICATION = 2;
    public int TYPE_ARTICLE = 3;
    public int TYPE_HELP = 4;
    public int TYPE_ABOUT = 5;

    public void startUserInfoActivity(Activity activity) {
        UserInfoActivity.startUserInfoActivity(activity);
    }

    public void startMyArticleActivity(Activity activity) {
        MyArticleActivity.startMyArticleActivity(activity);
    }

    public void startArticleDetailActivity(Activity activity, int id) {
        ArticleDetailActivity.startArticleDetailActivity(activity, id);
    }

    public void startAddArticleActivity(Activity activity) {
        AddDeviceActivity.startAddDeviceActivity(activity);
    }

    public void startDeviceDetailActivity(Activity activity, DeviceListEntity.DataDTO.DevicesDTO devicesDTO) {
        DeviceDetailActivity.startDeviceDetailActivity(activity, devicesDTO);
    }

    public void startAboutActivity(Activity activity) {
        AboutActivity.startAboutActivity(activity);
    }

    public void startMessageDetailActivity(Activity activity, int id) {
        MessageDetailActivity.startMessageDetailActivity(activity, id);
    }

}
